import java.util.stream.IntStream;


public class Leetcode1016 {

    public static void main(String[] args) {
        System.out.println(queryString(
                "0110",
                4
        ));
    }

    public static boolean queryString(String s, int n) {
        return IntStream.range(1, n+1).boxed().map(Integer::toBinaryString).allMatch(s::contains);
    }


}
